home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
prog
/
pas_all.zip
/
TI341.ASC
< prev
next >
Wrap
Text File
|
1991-09-11
|
854b
|
67 lines
PRODUCT : TURBO PASCAL NUMBER : 341
VERSION : 2.0xx
OS : 16-Bit
DATE : October 9, 1986 PAGE : 1/1
TITLE : RELEASE PROCEDURE UPDATET
This procedure is a work-around for a problem in version 2.0 of
Turbo Pascal that does not correctly release space on the heap
when a pointer is allocated with New and deallocated with
Release.
The following routine should be called instead of Release to free
space on the heap.
type
IntPtr = ^integer;
procedure ReleaseHeap(OldHeapPtr : IntPtr);
begin
FreeMem(OldHeapPtr, ((Seg(HeapPtr^) - Seg(OldHeapPtr^)) shl 4) +
(Ofs(HeapPtr^) - Ofs(OldHeapPtr^)));
end; { ReleaseHeap }